Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add operator interface for Probe pkg #4849

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

sukkyun2
Copy link
Contributor

@sukkyun2 sukkyun2 commented Aug 27, 2024

Proposed changes

This PR adds operator interface to probe pkg

#4836, I tried to add fuzz test for probe handler.
However, the current architecture made it impossible to mock probe operations, so I added probe operator interface.

This picture is about probe pkg.

image

References

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the commit for DCO to be passed.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

Dependency

  • Please add the links to the dependent PR need to be merged before this (if any).

Special notes for your reviewer:

I need feedback on the approach of passing probeOperator as a parameter to functions.

For example, the function GenerateExperimentManifestWithProbes in chaoscenter/graphql/server/pkg/probe/utils/utils.go directly accesses probe operation. I have added the probeOperator dependency to the handler that uses GenerateExperimentManifestWithProbes and updated the function calls to pass probeOperator as a parameter.

- Add probeOperator to probe pkg
- Add probeOperator to handler that uses probeUtils
- Add probe operator as parameter to functions that use probe operations in probeUtils

Signed-off-by: sukkyun2 <[email protected]>
- Apply goimports

Signed-off-by: sukkyun2 <[email protected]>
@sukkyun2 sukkyun2 force-pushed the refactor/add-operator-interface branch from 579cec1 to 5186dbf Compare August 28, 2024 09:32
@sukkyun2 sukkyun2 marked this pull request as ready for review August 28, 2024 09:45
@namkyu1999
Copy link
Member

can you check a build-pipeline? @sukkyun2

- Updated handler to call GenerateExperimentManifestWithProbes, GenerateCronExperimentManifestWithProbes via ProbeService

Signed-off-by: sukkyun2 <[email protected]>
- add mock probeService generated by mockery

Signed-off-by: sukkyun2 <[email protected]>
Signed-off-by: sukkyun2 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

4 participants